UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZQpAEGTGJA8c7ACXOr/nnF6pF+8VWltOoVuNfEZyZG0='
WHERE
key_id = '29235b6cc26f5d86aa6325433daa1c8c06f07c5012cd390f88779fe56dfbb652'
AND (
token = 'ZQpAEGTGJA8c7ACXOr/nnF6pF+8VWltOoVuNfEZyZG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)