UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P3BZIXMGM/TZsHCMT1+ap8yvIuOKB44w6d4ZZZvRHQ0='
WHERE
key_id = '88b8499d821952c0a0321fd92cb062ac0069014e2150dedee1c7c181585c43d5'
AND (
token = 'P3BZIXMGM/TZsHCMT1+ap8yvIuOKB44w6d4ZZZvRHQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)