UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/KFx1ETuLq6RjnUTfDgeufZ2stlkb/apNk9gi6jVOxM='
WHERE
key_id = '9fc088ff81806c241dc96df1f4ef0273585c82a0bde6ee7f23443099ad4d2951'
AND (
token = '/KFx1ETuLq6RjnUTfDgeufZ2stlkb/apNk9gi6jVOxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)