UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm/oa5Jbt7lnVZUj1UVf3V4jmXU84b8XrtP/cJ7xETUw=' 
WHERE 
  key_id = '55e3e7fa8f858375a868b46f6a1a8467ee70a107b58e3a56eb23be04e6fe93b6' 
  AND (
    token = 'm/oa5Jbt7lnVZUj1UVf3V4jmXU84b8XrtP/cJ7xETUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033