UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rrmk0l8RhySOWQibxfBjlOSjVnnfsJ27CyMOQLk6sk='
WHERE
key_id = '159f81df4da7f2d5f41bc6ec134a616b399b2226dfd950ba574edd9c3cee9bb1'
AND (
token = '3rrmk0l8RhySOWQibxfBjlOSjVnnfsJ27CyMOQLk6sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)