UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4JSfH1z+pYNn0FdObg+yM3G0KtRfNXCMtVuBrgfJuqg='
WHERE
key_id = '30a0518a3421863d150fb9c864d68c1d1881b16e630eac430e3396e9b8f64432'
AND (
token = '4JSfH1z+pYNn0FdObg+yM3G0KtRfNXCMtVuBrgfJuqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)