UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sBFuIwbzedhdD4UTh8ccIZk7rYyVDI/N79ZXiDxUGfg='
WHERE
key_id = '8b1c04be06f242b8c2d51be21e2e56f58486703a3b1ef8a626160bc4f1b41aa0'
AND (
token = 'sBFuIwbzedhdD4UTh8ccIZk7rYyVDI/N79ZXiDxUGfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)