UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'imxEs8dtrSoA1DhLsXVz3/DfJqSH4SS8EQXHBWM1QRQ=' 
WHERE 
  key_id = '36ef965c83874a0d78ff69b05df58d446dc6d758a8298b024e563dc0b034f451' 
  AND (
    token = 'imxEs8dtrSoA1DhLsXVz3/DfJqSH4SS8EQXHBWM1QRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029