UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uAOW+p97/8IJEdnVINJmkNkQ4u8A9VAFJvDo1ox5nTI=' 
WHERE 
  key_id = '5242d296bb8f28c4d96c72ff68ef7c64275c051263df891c3fb004b8d7faea41' 
  AND (
    token = 'uAOW+p97/8IJEdnVINJmkNkQ4u8A9VAFJvDo1ox5nTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030