UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dD5d399AP+izbdL3YGzgBExlKilgPmfpm7wsbQNhBvg=' 
WHERE 
  key_id = '0e26dbd57c2ab9da8e9e64d518123574b22a4ad42b4cf57b05a488a090c0d3c0' 
  AND (
    token = 'dD5d399AP+izbdL3YGzgBExlKilgPmfpm7wsbQNhBvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018