UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aFcdwRREyZXb1Kv5vExJpp4kdSfmYLtywefMzFMHODE='
WHERE
key_id = '1cda0e21765c4b49ecbc31a37d8db31d9f507ca278da6044a39a3bbc5cdd4289'
AND (
token = 'aFcdwRREyZXb1Kv5vExJpp4kdSfmYLtywefMzFMHODE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)