UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wtdLhxuuXmZVQRgogcwfJedAr6v0XUjwy+cQ6kYFFos=' 
WHERE 
  key_id = '591d68ea9153052ed29ae5dd25e588cf438e7ced6b1cf0d56a03c676cde0f598' 
  AND (
    token = 'wtdLhxuuXmZVQRgogcwfJedAr6v0XUjwy+cQ6kYFFos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054