UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dUctocVnzXQBsD93eeHts/1EPXMI/F5d9LS0WMYpyBw='
WHERE
key_id = '7c652bff9dee895f822b16fb86c3591b7ef1ad66ee00f37bc0c5777f39710699'
AND (
token = 'dUctocVnzXQBsD93eeHts/1EPXMI/F5d9LS0WMYpyBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)