UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FCA9Dfj26A2bboBElHxTWytxvYQMdz1wg0p6TgpirTs=' 
WHERE 
  key_id = '069d41e0cb50dd71c3751219dc43e8c86cc7b4c3617efd4f9c4b4205fd8bbcfb' 
  AND (
    token = 'FCA9Dfj26A2bboBElHxTWytxvYQMdz1wg0p6TgpirTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039