UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zY/fsTKRtB3caCdlBLY6V6mg10gpWVHT5DhymNH7PGs=' 
WHERE 
  key_id = 'e0c07d90b7f4bc4548d139b474f14ec51e8c5761e7aab7388faddb9d944e6849' 
  AND (
    token = 'zY/fsTKRtB3caCdlBLY6V6mg10gpWVHT5DhymNH7PGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044