UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78A90FEC/3PqFrz7ffCBRQHoYvGjd3X0jOD3/k5zGuM='
WHERE
key_id = '84c69445aa5ff661dae8a88833c9274535064f8ba31df9b2057662f4ee4f8a5d'
AND (
token = '78A90FEC/3PqFrz7ffCBRQHoYvGjd3X0jOD3/k5zGuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)