UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EZx9wqwSzdJoAktFo/v2xzWZIUiJxnthhJSU0Io2R3Y=' 
WHERE 
  key_id = 'a8f88a4cf7ca82679cc172a5cd78b063b851e58d6789fa477402aad587009020' 
  AND (
    token = 'EZx9wqwSzdJoAktFo/v2xzWZIUiJxnthhJSU0Io2R3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026