UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A1JVCOiTUfqEgs3wy5qeEOMpInNVJ543JgZj6UYnpd4='
WHERE
key_id = '4f79ddc409ed2d4a489c86f3c10075e0f6c1dfec8f50f036b0a4396862b0bb19'
AND (
token = 'A1JVCOiTUfqEgs3wy5qeEOMpInNVJ543JgZj6UYnpd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)