UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ob32q618Xdz98P/znSqMnEM+3d1Ap7GR9SdlVIfzsQ8='
WHERE
key_id = '53a9a0edb01bfacd4099cf00cec8620a2184d329bbe7d4531f10895263e8dd99'
AND (
token = 'Ob32q618Xdz98P/znSqMnEM+3d1Ap7GR9SdlVIfzsQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)