UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dp99kaxoNzdHttD4hBTkJGCcniqkEG9O23gi4e/SjtA='
WHERE
key_id = '2e65058f1d92e6f9fd2436a8fe639b5a3177fe8ca065ce1e044674674dbb5438'
AND (
token = 'Dp99kaxoNzdHttD4hBTkJGCcniqkEG9O23gi4e/SjtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)