UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vSk/HdyG31B+bKaS637xA+GS3aHBeNGGjdjU212cbQI=' 
WHERE 
  key_id = 'b597bc34f8672f34faf45eb29f8dff53ff99d44a7ff4297b5138a60303c0dbfa' 
  AND (
    token = 'vSk/HdyG31B+bKaS637xA+GS3aHBeNGGjdjU212cbQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037