UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4FvzXVpfPcYYdf0DWI0MrcUqY6uqjPesLaRCcNhQwzI='
WHERE
key_id = '3a298c2640a3d70bc1bc94e4cd5cb8ef88ab9485f40b0accd11220d313017a06'
AND (
token = '4FvzXVpfPcYYdf0DWI0MrcUqY6uqjPesLaRCcNhQwzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)