UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MOoObMqx+4w8Bf6CiEpUG8xRMJAWKUoevrrjSuSOxgk=' 
WHERE 
  key_id = 'e0541fd9a7e99685b7c8f2b7db0925d1fe72ea3c9e72884e19b84b256a0a77d7' 
  AND (
    token = 'MOoObMqx+4w8Bf6CiEpUG8xRMJAWKUoevrrjSuSOxgk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029