UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AbCDKXXwLnQdetjziYw/A1ewYso/gNDzqZ17lZqEJdU='
WHERE
key_id = 'ee5a4f57d564ff3d5de86276cdddf0018fbb744a86612cb221b512f1d1ee5b5f'
AND (
token = 'AbCDKXXwLnQdetjziYw/A1ewYso/gNDzqZ17lZqEJdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)