UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zFm+hinvNY/pVzfy/z2ULyVrA6FDo8Pw9blA+sZZ//4='
WHERE
key_id = '00bc7a5ddc034ddbe01fb137f758807feda483f299af1f9ac6d2d2f1f764d479'
AND (
token = 'zFm+hinvNY/pVzfy/z2ULyVrA6FDo8Pw9blA+sZZ//4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)