UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0YcnqjfPZglY0dKiXMJTAbNdp1SV4IWKVyEYwmAdaE='
WHERE
key_id = '0d298f79210aba7d6db8cbcab3a4784b994ed5f90136c67922590494140a674a'
AND (
token = 'Z0YcnqjfPZglY0dKiXMJTAbNdp1SV4IWKVyEYwmAdaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)