UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jsz+Rcj64IrWc1cXbmz6htUNslJkZOBcfK4IRdFfMOA='
WHERE
key_id = 'bf578da61670a0ea1a701fc3faace9f4c706c5f2bc3b87b9fb37fa9187ed982a'
AND (
token = 'Jsz+Rcj64IrWc1cXbmz6htUNslJkZOBcfK4IRdFfMOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)