UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kgTn+jaR+loK3106tk6ZdnNu/ct7W0vttSzYkQ3zWTw='
WHERE
key_id = '8f1887c22fbec8a4808adacd12ac31acdc6be48aca3d3eff27b3214331643c8f'
AND (
token = 'kgTn+jaR+loK3106tk6ZdnNu/ct7W0vttSzYkQ3zWTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)