UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K8oP183pu6pxVPf2QXji9jESW1yqiBJJCYJWXMTaWVA='
WHERE
key_id = '67a80ad8cf4259c1dc86fe6e1f951e0dcdcca0e5286a1e2382ac67c0fc9073af'
AND (
token = 'K8oP183pu6pxVPf2QXji9jESW1yqiBJJCYJWXMTaWVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)