UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f4XDrQs03ceXLCqpgeYwfXYtgsl31Q/E0MQ6gRQKCfg=' 
WHERE 
  key_id = 'af0331892e0d9946610e9d1b3e6115d8f8954d6c0a9ae6a432b0de8863ae5880' 
  AND (
    token = 'f4XDrQs03ceXLCqpgeYwfXYtgsl31Q/E0MQ6gRQKCfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016