UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1WP3DLw2kwdSZc4si8bAyzsp5qk5oRWuPf+XFNOUBos='
WHERE
key_id = 'afd1f6a24b602ee031326cf8f6ff4da2b7653f58d71e1556d5d1831b14d9bb31'
AND (
token = '1WP3DLw2kwdSZc4si8bAyzsp5qk5oRWuPf+XFNOUBos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)