UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2cpVU5/+ETWmsnlK8EKaxK5z5BTG6C7xnNX0Sl7kQrA='
WHERE
key_id = '1d592f9c4bc9a685dd07495d5e525df94f81c6e3f494ca4171725df45dd15eac'
AND (
token = '2cpVU5/+ETWmsnlK8EKaxK5z5BTG6C7xnNX0Sl7kQrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)