UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DbQrZlw7Czx8+T2ixJlwvG26r8dXIv8+RwMHmQmj7ow=' 
WHERE 
  key_id = 'a69729bc8d87a9b57181ce2410ecf08b40711306e6e364caafa7e1877f07c585' 
  AND (
    token = 'DbQrZlw7Czx8+T2ixJlwvG26r8dXIv8+RwMHmQmj7ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025