UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WBZqUMDj62IpnBAqIxb9omi8GIwNvl3TxiVH1uq/F9U=' 
WHERE 
  key_id = '0ae97c5f9707925d4c214b5900426343e4839242c545d5ad0397fcf92939183b' 
  AND (
    token = 'WBZqUMDj62IpnBAqIxb9omi8GIwNvl3TxiVH1uq/F9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00158