UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vritBMhihCPWtTF8Mr6me4HQE4+/UMlkdL/ByGyC5EY=' 
WHERE 
  key_id = '505d005680d0915d69fcebf5dd50f28182cd9da58a9ef5320db7fb69fadec4f9' 
  AND (
    token = 'vritBMhihCPWtTF8Mr6me4HQE4+/UMlkdL/ByGyC5EY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049