UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+yEwRZgYbjL2X8Ltik/rNTIawlKaGVvzKrwPXxjenhI='
WHERE
key_id = 'c8cc510e4d73afbf38557bac4cc62eaf1f3a62747033dffece217d1f0ab2f0c9'
AND (
token = '+yEwRZgYbjL2X8Ltik/rNTIawlKaGVvzKrwPXxjenhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)