UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b9ByNdAO+Vou36pGX7+3C/lZ7aW80urR+vdpqpOYDCs=' 
WHERE 
  key_id = 'eab8d987ce0386d7b3066443dc9d723c5ab7c9b0d8fe721bc4e3aec04c759b35' 
  AND (
    token = 'b9ByNdAO+Vou36pGX7+3C/lZ7aW80urR+vdpqpOYDCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036