UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pfMFeHHxDX2aDidNs1eJ0kNeMtvzkm77vIMt08fXZOA='
WHERE
key_id = '301fba9a7899c201ebf75bb146095bece01a887dae6f2c30dcfd217ca33da7fa'
AND (
token = 'pfMFeHHxDX2aDidNs1eJ0kNeMtvzkm77vIMt08fXZOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)