UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A0gZHAjoS8RI2nJVZQmylEO8/Cbq9t++L9eWKige/vg=' 
WHERE 
  key_id = '21c40a750d74caf097caf6e9316bba67c10c562e89ec9c74ca4ea47cb0ad7864' 
  AND (
    token = 'A0gZHAjoS8RI2nJVZQmylEO8/Cbq9t++L9eWKige/vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048