UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dD9xeq4+Vz3+5kgLRdP7CJtr3Yn0J727Z+R3FOWzl3w='
WHERE
key_id = '911538ca755ae235231529ee9f4c940ec3136f9f8d46d8a01eaa674a11065a4c'
AND (
token = 'dD9xeq4+Vz3+5kgLRdP7CJtr3Yn0J727Z+R3FOWzl3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)