UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h4TZtbbY+e7CZ3g+D/Qca+oqRV5xELQlYSq0RVExxLQ='
WHERE
key_id = '039002888ac0f03740c065f93e0f018656d59393c01d4d3d3c3e6aaad5ef4d86'
AND (
token = 'h4TZtbbY+e7CZ3g+D/Qca+oqRV5xELQlYSq0RVExxLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)