UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6N7A3K383xSDkSPbSPYUzuu2pepHX89GmP40o4g/UyM='
WHERE
key_id = 'd6c664d27a7d2cccab8447ecd03e4489b1fc3330ff621410fd4c57bdfdc8088c'
AND (
token = '6N7A3K383xSDkSPbSPYUzuu2pepHX89GmP40o4g/UyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)