UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bCCTQWrD4CbI5VrO11KVtU5RUdlex48xePcrEj0vw/c='
WHERE
key_id = 'af0cdd9bb6422b75be17fc3d3dd0f70b453c1e483852dff1df04d5049605cca3'
AND (
token = 'bCCTQWrD4CbI5VrO11KVtU5RUdlex48xePcrEj0vw/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)