UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HFbUAvxB9gmkG0g7PRm1ktIvW585Atjs6XchvMpvwtI=' 
WHERE 
  key_id = '22dc341af9fe9f5243d629a0982ba8458c88fa70edd287bfe2d3daece1cc1e46' 
  AND (
    token = 'HFbUAvxB9gmkG0g7PRm1ktIvW585Atjs6XchvMpvwtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016