UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6d+TT6wBGgiLRYwL8iUXoYvwox3jQ9Vbb0pyjCTIFps='
WHERE
key_id = '619b6a2807ed933781da9644f3a1bf3fbb66828ad618799b5fad9677fb01300f'
AND (
token = '6d+TT6wBGgiLRYwL8iUXoYvwox3jQ9Vbb0pyjCTIFps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)