UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'enSmfLTFYT1jjzXSTRZ54cnm5eNLa1xi+hMCAOhJz9s=' 
WHERE 
  key_id = 'ff2e8c791d8b3edfaf4bdbac44199c3a33e8538415d6d351eb707b844b79dde3' 
  AND (
    token = 'enSmfLTFYT1jjzXSTRZ54cnm5eNLa1xi+hMCAOhJz9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030