UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6fdGnVl4+AZs/Y4KQYLIZ+IWZvfJeMM0hIIBcMluv+g=' 
WHERE 
  key_id = 'ce29d23ef2223a84dd7f3867b958abc6f4ebc296b9bbdf7cdf3e96fdc90541b5' 
  AND (
    token = '6fdGnVl4+AZs/Y4KQYLIZ+IWZvfJeMM0hIIBcMluv+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048