UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZpdS0CioAc4IaHArje5dJPvJkbWuRR7V/5eRZ+URBRI='
WHERE
key_id = '732e353026ac25741cdaf752063d930e0ae8f178f9aec0a7d13bb6659bf15db7'
AND (
token = 'ZpdS0CioAc4IaHArje5dJPvJkbWuRR7V/5eRZ+URBRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)