UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FdgSN/kykRvBXD/Cmo3ZjlNPmDqjfueXng2pcQpxG48=' 
WHERE 
  key_id = 'e170b2e74a5363c16ac8ee3b3c910ca6ebd6716857ab816b74872dbc525a91f6' 
  AND (
    token = 'FdgSN/kykRvBXD/Cmo3ZjlNPmDqjfueXng2pcQpxG48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026