UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nxr92xbr+CEwR5SQ56XtRkAti3uTexOg5m8BgKCQHV8='
WHERE
key_id = 'f75d24a3a1d3987885586b06e31f2dc6238e5f4f20692d742c4151a65def2f1d'
AND (
token = 'Nxr92xbr+CEwR5SQ56XtRkAti3uTexOg5m8BgKCQHV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)