UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xid8pWMKYJ/shqhAmVQ8c8ejKKfs9vbtm+BDemAmqeY='
WHERE
key_id = 'd132fd090e4e0556e98b140a2799a55dbef33679797c723e25237e9d93382d61'
AND (
token = 'xid8pWMKYJ/shqhAmVQ8c8ejKKfs9vbtm+BDemAmqeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)