UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rguk7P/ROXzxtKJx2fF1ga60VHpi8NcKyei2vGk7btM='
WHERE
key_id = 'e7f7dd76d2079ef1e106f10a9d8b783b72f9fff9bfa2773bcf51122d9ea1a5a8'
AND (
token = 'rguk7P/ROXzxtKJx2fF1ga60VHpi8NcKyei2vGk7btM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)