UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cjIVWWzjgHi1AP/ggtYH7C3cnewaIk/I58FLSa6CkA='
WHERE
key_id = '8c00b57a5ac58a8a5dabbf33bafd6c95ec0d9e4c3f5ccc78de14d56774832205'
AND (
token = '5cjIVWWzjgHi1AP/ggtYH7C3cnewaIk/I58FLSa6CkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)