UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vm+ItXcjXmy/8QkytN92hhDU6LEG9WfwfSF7Y6//63o='
WHERE
key_id = 'a3c505b9649557faea94cb2ade4056c5375faa478e3fde77bdfd5c106c453a55'
AND (
token = 'Vm+ItXcjXmy/8QkytN92hhDU6LEG9WfwfSF7Y6//63o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)